<template>
    <doc-main>
        <data-table class="table table-bordered" :tableHead="trList" :tableData="dataList" :edit="editFunc"
                    :trash="trashFunc" :info="infoFunc" :currentPage="1" :totalPage="20" :insert="a"
                    :redirectPagination="pageClick"></data-table>
        <advanced-table class="table-bordered table-hover" :head="head" :currentPage="1" :totalPage="20" :insert="a"
                        :redirectPagination="pageClick">
            <tr>
                <td>1</td>
                <td class="">66666</td>
            </tr>
        </advanced-table>
    </doc-main>
</template>

<script>
    import DocMain from '../layout/DocMain.vue';
    import DataTable from '../../../js/components/table/DataTable.vue';
    import AdvancedTable from '../../../js/components/table/AdvancedTable.vue';

    export default {
        components: {
            AdvancedTable,
            DataTable,
            DocMain
        },
        data () {
            return {
                trList: [
                    {text: 'name'}
                ],
                dataList: [
                    {
                        id: 1,
                        data: [
                            1111111111111111111
                        ]
                    },
                    {
                        id: 2,
                        data: [
                            2222222222222222222222
                        ]
                    },
                    {
                        id: 3,
                        data: [
                            3333333333333333333
                        ]
                    }
                ],
                head: [
                    {class: 'text-center', label: '#'},
                    {class: 'text-center', label: 'name'}
                ]
            };
        },
        methods: {
            editFunc (id) {
                console.info('edit func' + id);
            },
            trashFunc (id) {
                console.info('trash func' + id);
            },
            infoFunc (id) {
                console.info('info func' + id);
            },
            d (ids) {
                console.info(ids);
            },
            a () {
                console.info('inset data');
            },
            pageClick (page) {
                console.info('switch page to' + page);
            }
        }
    };
</script>

<style>

</style>
